package com.kuang.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kuang.entity.Gift;
import com.kuang.entity.GiftWarehouse;
import com.kuang.service.GiftService;
import com.kuang.service.GiftWarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类说明
 *
 * @author liaosheng
 * @date 2021-04-29
 */
@RestController
@RequestMapping(value = "/giftWarehouse")
public class GiftWarehouseController {
    @Autowired
    private GiftWarehouseService giftWarehouseService;
    @PostMapping("/add")
    public GiftWarehouse add(GiftWarehouse giftWarehouse){
       return this.giftWarehouseService.add(giftWarehouse);

    }

    @PostMapping("/update")
    public void update(GiftWarehouse giftWarehouse){
        giftWarehouseService.update(giftWarehouse);
    }

    @GetMapping("/list")
    public Page<GiftWarehouse> list(){
       return giftWarehouseService.page();
    }
}
